package com.example.testwebrtc

import android.util.Log
import org.webrtc.*

open class PeerConnectionImpl(tag:String) : PeerConnection.Observer{
    val tag = tag
    override fun onSignalingChange(p0: PeerConnection.SignalingState?) {
        Log.e("onSignalingChange","$tag ${p0.toString()}")
    }

    override fun onIceConnectionChange(p0: PeerConnection.IceConnectionState?) {
        Log.e("onIceConnectionChange","$tag ${p0.toString()}")
    }

    override fun onIceConnectionReceivingChange(p0: Boolean) {
        Log.e("onIceConnectionReceivingChange","$tag ${p0.toString()}")
    }

    override fun onIceGatheringChange(p0: PeerConnection.IceGatheringState?) {
        Log.e("onIceGatheringChange","$tag ${p0.toString()}")
    }

    override fun onIceCandidate(p0: IceCandidate?) {
        Log.e("onIceCandidate","$tag ${p0.toString()}")
    }

    override fun onIceCandidatesRemoved(p0: Array<out IceCandidate>?) {
        Log.e("onIceCandidatesRemoved","$tag ${p0.toString()}")
    }

    override fun onAddStream(p0: MediaStream?) {
        Log.e("onAddStream","$tag ${p0.toString()}")
    }

    override fun onRemoveStream(p0: MediaStream?) {
        Log.e("onRemoveStream","$tag ${p0.toString()}")
    }

    override fun onDataChannel(p0: DataChannel?) {
        Log.e("onDataChannel","$tag ${p0.toString()}")
    }

    override fun onRenegotiationNeeded() {
        Log.e("onRenegotiationNeeded","$tag onRenegotiationNeeded}")
    }

    override fun onAddTrack(p0: RtpReceiver?, p1: Array<out MediaStream>?) {
        Log.e("onAddTrack","$tag ${p0.toString()}")
    }
}